package com.yhcui.rabbit.tools;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;

public class JsonEditorUtils {

    public static void main(String[] args) {

        String jsonStr = "[\n" +
                "  {\n" +
                "    \"name\": \"Kano Electricity - Prepaid\",\n" +
                "    \"id\": \"capricorn_kano_prepaid\",\n" +
                "    \"status\": \"available\",\n" +
                "    \"promptDesc\": \"\",\n" +
                "    \"unAvailableDesc\": \"Sorry, the system is being upgraded and maintained, please try again later.\",\n" +
                "    \"fields\": [\n" +
                "      {\n" +
                "        \"code\": \"recipientAccount\",\n" +
                "        \"displayName\": \"Meter Number\",\n" +
                "        \"values\": [\n" +
                "          \n" +
                "        ]\n" +
                "      }\n" +
                "    ]\n" +
                "  },\n" +
                "  {\n" +
                "    \"name\": \"Kano Electricity - Postpaid\",\n" +
                "    \"id\": \"capricorn_kano_postpaid\",\n" +
                "    \"status\": \"available\",\n" +
                "    \"promptDesc\": \"\",\n" +
                "    \"unAvailableDesc\": \"Sorry, the system is being upgraded and maintained, please try again later.\",\n" +
                "    \"fields\": [\n" +
                "      {\n" +
                "        \"code\": \"recipientAccount\",\n" +
                "        \"displayName\": \"Meter Number\",\n" +
                "        \"values\": [\n" +
                "          \n" +
                "        ]\n" +
                "      }\n" +
                "    ]\n" +
                "  },\n" +
                "  {\n" +
                "    \"name\": \"Abuja Electricity - Prepaid\",\n" +
                "    \"id\": \"capricorn_abuja_prepaid\",\n" +
                "    \"status\": \"available\",\n" +
                "    \"promptDesc\": \"\",\n" +
                "    \"unAvailableDesc\": \"Sorry, the system is being upgraded and maintained, please try again later.\",\n" +
                "    \"fields\": [\n" +
                "      {\n" +
                "        \"code\": \"recipientAccount\",\n" +
                "        \"displayName\": \"Meter Number\",\n" +
                "        \"values\": [\n" +
                "          \n" +
                "        ]\n" +
                "      },\n" +
                "      {\n" +
                "        \"code\": \"meterType\",\n" +
                "        \"displayName\": \"Meter Type\",\n" +
                "        \"values\": [\n" +
                "          \"STS_PREPAID\",\n" +
                "          \"SMART_METER\"\n" +
                "        ]\n" +
                "      }\n" +
                "    ]\n" +
                "  },\n" +
                "  {\n" +
                "    \"name\": \"Abuja Electricity - Postpaid\",\n" +
                "    \"id\": \"capricorn_abuja_postpaid\",\n" +
                "    \"status\": \"available\",\n" +
                "    \"promptDesc\": \"\",\n" +
                "    \"unAvailableDesc\": \"Sorry, the system is being upgraded and maintained, please try again later.\",\n" +
                "    \"fields\": [\n" +
                "      {\n" +
                "        \"code\": \"recipientAccount\",\n" +
                "        \"displayName\": \"Meter Number\",\n" +
                "        \"values\": [\n" +
                "          \n" +
                "        ]\n" +
                "      }\n" +
                "    ]\n" +
                "  },\n" +
                "  {\n" +
                "    \"name\": \"Ikeja Disco - Token Purchase\",\n" +
                "    \"id\": \"capricorn_ikeja_prepaid\",\n" +
                "    \"status\": \"available\",\n" +
                "    \"promptDesc\": \"\",\n" +
                "    \"unAvailableDesc\": \"Sorry, the system is being upgraded and maintained, please try again later.\",\n" +
                "    \"fields\": [\n" +
                "      {\n" +
                "        \"code\": \"recipientAccount\",\n" +
                "        \"displayName\": \"Meter Number\",\n" +
                "        \"values\": [\n" +
                "          \n" +
                "        ]\n" +
                "      },\n" +
                "      {\n" +
                "        \"code\": \"recipientPhoneNumber\",\n" +
                "        \"displayName\": \"Phone Number\",\n" +
                "        \"values\": [\n" +
                "          \n" +
                "        ]\n" +
                "      },\n" +
                "      {\n" +
                "        \"code\": \"customerEmail\",\n" +
                "        \"displayName\": \"Email\",\n" +
                "        \"values\": [\n" +
                "          \n" +
                "        ]\n" +
                "      },\n" +
                "      {\n" +
                "        \"code\": \"details\",\n" +
                "        \"displayName\": \"Contact Type\",\n" +
                "        \"values\": [\n" +
                "          \"LANDLORD\",\n" +
                "          \"TENANT\"\n" +
                "        ]\n" +
                "      }\n" +
                "    ]\n" +
                "  },\n" +
                "  {\n" +
                "    \"name\": \"Ikeja Disco - Postpaid\",\n" +
                "    \"id\": \"capricorn_ikeja_postpaid\",\n" +
                "    \"status\": \"available\",\n" +
                "    \"promptDesc\": \"\",\n" +
                "    \"unAvailableDesc\": \"Sorry, the system is being upgraded and maintained, please try again later.\",\n" +
                "    \"fields\": [\n" +
                "      {\n" +
                "        \"code\": \"recipientAccount\",\n" +
                "        \"displayName\": \"Account Number\",\n" +
                "        \"values\": [\n" +
                "          \n" +
                "        ]\n" +
                "      },\n" +
                "      {\n" +
                "        \"code\": \"recipientPhoneNumber\",\n" +
                "        \"displayName\": \"Phone Number\",\n" +
                "        \"values\": [\n" +
                "          \n" +
                "        ]\n" +
                "      },\n" +
                "      {\n" +
                "        \"code\": \"customerEmail\",\n" +
                "        \"displayName\": \"Email\",\n" +
                "        \"values\": [\n" +
                "          \n" +
                "        ]\n" +
                "      },\n" +
                "      {\n" +
                "        \"code\": \"details\",\n" +
                "        \"displayName\": \"Contact Type\",\n" +
                "        \"values\": [\n" +
                "          \"LANDLORD\",\n" +
                "          \"TENANT\"\n" +
                "        ]\n" +
                "      }\n" +
                "    ]\n" +
                "  },\n" +
                "  {\n" +
                "    \"name\": \"Eko Electricity - Prepaid\",\n" +
                "    \"id\": \"capricorn_eko_prepaid\",\n" +
                "    \"status\": \"available\",\n" +
                "    \"promptDesc\": \"\",\n" +
                "    \"unAvailableDesc\": \"Sorry, the system is being upgraded and maintained, please try again later.\",\n" +
                "    \"fields\": [\n" +
                "      {\n" +
                "        \"code\": \"recipientAccount\",\n" +
                "        \"displayName\": \"Meter Number\",\n" +
                "        \"values\": [\n" +
                "          \n" +
                "        ]\n" +
                "      }\n" +
                "    ]\n" +
                "  },\n" +
                "  {\n" +
                "    \"name\": \"Eko Electricity - Postpaid\",\n" +
                "    \"id\": \"capricorn_eko_postpaid\",\n" +
                "    \"status\": \"available\",\n" +
                "    \"promptDesc\": \"\",\n" +
                "    \"unAvailableDesc\": \"Sorry, the system is being upgraded and maintained, please try again later.\",\n" +
                "    \"fields\": [\n" +
                "      {\n" +
                "        \"code\": \"recipientAccount\",\n" +
                "        \"displayName\": \"Account Number\",\n" +
                "        \"values\": [\n" +
                "          \n" +
                "        ]\n" +
                "      }\n" +
                "    ]\n" +
                "  },\n" +
                "  {\n" +
                "    \"name\": \"Ibadan Electricity - Prepaid\",\n" +
                "    \"id\": \"capricorn_ibadan_prepaid\",\n" +
                "    \"status\": \"available\",\n" +
                "    \"promptDesc\": \"\",\n" +
                "    \"unAvailableDesc\": \"Sorry, the system is being upgraded and maintained, please try again later.\",\n" +
                "    \"fields\": [\n" +
                "      {\n" +
                "        \"code\": \"recipientAccount\",\n" +
                "        \"displayName\": \"Meter Number\",\n" +
                "        \"values\": [\n" +
                "          \n" +
                "        ]\n" +
                "      }\n" +
                "    ]\n" +
                "  },\n" +
                "  {\n" +
                "    \"name\": \"Ibadan Electricity - Postpaid\",\n" +
                "    \"id\": \"capricorn_ibadan_postpaid\",\n" +
                "    \"status\": \"available\",\n" +
                "    \"promptDesc\": \"\",\n" +
                "    \"unAvailableDesc\": \"Sorry, the system is being upgraded and maintained, please try again later.\",\n" +
                "    \"fields\": [\n" +
                "      {\n" +
                "        \"code\": \"recipientAccount\",\n" +
                "        \"displayName\": \"Account Number\",\n" +
                "        \"values\": [\n" +
                "          \n" +
                "        ]\n" +
                "      }\n" +
                "    ]\n" +
                "  },\n" +
                "  {\n" +
                "    \"name\": \"Kaduna Electricity - Prepaid\",\n" +
                "    \"id\": \"buypower_kaduna_prepaid\",\n" +
                "    \"status\": \"available\",\n" +
                "    \"promptDesc\": \"\",\n" +
                "    \"unAvailableDesc\": \"Sorry, the system is being upgraded and maintained, please try again later.\",\n" +
                "    \"fields\": [\n" +
                "      {\n" +
                "        \"code\": \"recipientAccount\",\n" +
                "        \"displayName\": \"Meter Number\",\n" +
                "        \"values\": [\n" +
                "          \n" +
                "        ]\n" +
                "      }\n" +
                "    ]\n" +
                "  },\n" +
                "  {\n" +
                "    \"name\": \"Kaduna Electricity - Postpaid\",\n" +
                "    \"id\": \"buypower_kaduna_postpaid\",\n" +
                "    \"status\": \"available\",\n" +
                "    \"promptDesc\": \"\",\n" +
                "    \"unAvailableDesc\": \"Sorry, the system is being upgraded and maintained, please try again later.\",\n" +
                "    \"fields\": [\n" +
                "      {\n" +
                "        \"code\": \"recipientAccount\",\n" +
                "        \"displayName\": \"Account Number\",\n" +
                "        \"values\": [\n" +
                "          \n" +
                "        ]\n" +
                "      }\n" +
                "    ]\n" +
                "  },\n" +
                "  {\n" +
                "    \"name\": \"Jos Electricity - Prepaid\",\n" +
                "    \"id\": \"buypower_jos_prepaid\",\n" +
                "    \"status\": \"available\",\n" +
                "    \"promptDesc\": \"\",\n" +
                "    \"unAvailableDesc\": \"Sorry, the system is being upgraded and maintained, please try again later.\",\n" +
                "    \"fields\": [\n" +
                "      {\n" +
                "        \"code\": \"recipientAccount\",\n" +
                "        \"displayName\": \"Meter Number\",\n" +
                "        \"values\": [\n" +
                "          \n" +
                "        ]\n" +
                "      }\n" +
                "    ]\n" +
                "  },\n" +
                "  {\n" +
                "    \"name\": \"Jos Electricity - Postpaid\",\n" +
                "    \"id\": \"buypower_jos_postpaid\",\n" +
                "    \"status\": \"available\",\n" +
                "    \"promptDesc\": \"\",\n" +
                "    \"unAvailableDesc\": \"Sorry, the system is being upgraded and maintained, please try again later.\",\n" +
                "    \"fields\": [\n" +
                "      {\n" +
                "        \"code\": \"recipientAccount\",\n" +
                "        \"displayName\": \"Account Number\",\n" +
                "        \"values\": [\n" +
                "          \n" +
                "        ]\n" +
                "      }\n" +
                "    ]\n" +
                "  },\n" +
                "  {\n" +
                "    \"name\": \"Enugu Electricity - Prepaid\",\n" +
                "    \"id\": \"buypower_enugu_prepaid\",\n" +
                "    \"status\": \"available\",\n" +
                "    \"promptDesc\": \"\",\n" +
                "    \"unAvailableDesc\": \"Sorry, the system is being upgraded and maintained, please try again later.\",\n" +
                "    \"fields\": [\n" +
                "      {\n" +
                "        \"code\": \"recipientAccount\",\n" +
                "        \"displayName\": \"Meter Number\",\n" +
                "        \"values\": [\n" +
                "          \n" +
                "        ]\n" +
                "      }\n" +
                "    ]\n" +
                "  },\n" +
                "  {\n" +
                "    \"name\": \"Enugu Electricity - Postpaid\",\n" +
                "    \"id\": \"buypower_enugu_postpaid\",\n" +
                "    \"status\": \"available\",\n" +
                "    \"promptDesc\": \"\",\n" +
                "    \"unAvailableDesc\": \"Sorry, the system is being upgraded and maintained, please try again later.\",\n" +
                "    \"fields\": [\n" +
                "      {\n" +
                "        \"code\": \"recipientAccount\",\n" +
                "        \"displayName\": \"Account Number\",\n" +
                "        \"values\": [\n" +
                "          \n" +
                "        ]\n" +
                "      }\n" +
                "    ]\n" +
                "  },\n" +
                "  {\n" +
                "    \"name\": \"Port harcourt - Prepaid\",\n" +
                "    \"id\": \"buypower_ph_prepaid\",\n" +
                "    \"status\": \"available\",\n" +
                "    \"promptDesc\": \"\",\n" +
                "    \"unAvailableDesc\": \"Sorry, the system is being upgraded and maintained, please try again later.\",\n" +
                "    \"fields\": [\n" +
                "      {\n" +
                "        \"code\": \"recipientAccount\",\n" +
                "        \"displayName\": \"Meter Number\",\n" +
                "        \"values\": [\n" +
                "          \n" +
                "        ]\n" +
                "      }\n" +
                "    ]\n" +
                "  },\n" +
                "  {\n" +
                "    \"name\": \"Port harcourt - Postpaid\",\n" +
                "    \"id\": \"buypower_ph_postpaid\",\n" +
                "    \"status\": \"available\",\n" +
                "    \"promptDesc\": \"\",\n" +
                "    \"unAvailableDesc\": \"Sorry, the system is being upgraded and maintained, please try again later.\",\n" +
                "    \"fields\": [\n" +
                "      {\n" +
                "        \"code\": \"recipientAccount\",\n" +
                "        \"displayName\": \"Account Number\",\n" +
                "        \"values\": [\n" +
                "          \n" +
                "        ]\n" +
                "      }\n" +
                "    ]\n" +
                "  }\n" +
                "]";
        JSONArray objArr = JSON.parseArray(jsonStr);


        String result = objArr.toJSONString();
        System.out.println(result);
    }
}
